import {createRouter,createWebHashHistory} from "vue-router"


let routes = [
    {
        path:"/",
        name:"/",
        meta:{
            name:"发现首页"
        },
        component:()=>import("../pages/home/index.vue"),
        children:[
            {
                path:"discover",
                name:"discover",
                meta:{
                    name:"发现"
                },
                component:()=>import("../pages/discover/index.vue"),
                redirect:"/discover/paylist",
                children:[
                    {
                        path:"paylist",
                        name:"paylist",
                        meta:{
                            name:"歌单"
                        },
                        component:()=>import("../pages/discover/playlist/index.vue")
                    }
                ]
            },
            {
                path:"friend",
                name:"friend",
                meta:{
                    name:"朋友"
                },
                component:()=>import("../pages/friend/index.vue")
            },
            {
                path:"mine",
                name:"mine",
                meta:{
                    name:"个人中心"
                },
                component:()=>import("../pages/mine/index.vue")
            }
        ]
    },
    {
        path:"/login",
        name:"login",
        meta:{
            name:"登录"
        },
        component:()=>import("../pages/login/index.vue")
    }
    
]


const router = createRouter({
    history: createWebHashHistory("/base"),
    routes,
  })
  

  export default router